package com.project.webpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.webpage.aop.TagLog;
import com.project.webpage.dto.SearchByRqParam;
import com.project.webpage.service.CzclRfidDayService;
import com.project.webpage.service.CzxlRfidDayService;
import com.project.webpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/webpage/czxlrfid/")
public class CzxlRfidDayController extends BaseController {

    @Resource
    CzxlRfidDayService czxlRfidDayService;

    /**
     * 企业线路监测质量汇总报告列表查询
     */
    @PostMapping("page")
    @TagLog(operation = 0, content = "查询企业线路监测质量汇总报告列表")
    public RestResult page(@RequestBody SearchByRqParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(czxlRfidDayService.getListForPage(param)));
    }

    /**
     * 企业线路监测质量汇总报告导出列表
     */
    @PostMapping("output")
    @TagLog(operation = 5, content = "导出企业线路监测质量汇总报告列表")
    public RestResult output(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(czxlRfidDayService.getListForPage(param));
    }
}
